<script>
$(document).ready(function(){
  var sourceCounter=0;
  var sourceList=new Array();
  $('div#tab_sources').prepend('<ul/>');
  list = $('div#tab_sources ul');
  $('link[@href]').each(function(){
    href=$(this).attr('href');
    if( !sourceList[href] )
    {
      sourceCounter++;
      sourceList[href] = true;
      list.append('<li>'+sourceCounter+': <a href="'+href+'">'+href+'</li>');
    }
  });
  $('img[@src]').each(function(){
    src=$(this).attr('src');
    if( !sourceList[src] )
    {
      sourceCounter++;
      sourceList[src] = true;
      list.append('<li>'+sourceCounter+': <a href="'+src+'">'+src+'</li>');
    }
  });
  $('style[@src]').each(function(){
    src=$(this).attr('src');
    if( !sourceList[src] )
    {
      sourceCounter++;
      sourceList[src] = true;
      list.append('<li>'+sourceCounter+': <a href="'+src+'">'+src+'</li>');
    }
  });
  $('a[@href=\"#tab_sources\"] span').append('<small>('+sourceCounter+')</small>');
});
</script>
